package com.team7.order.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.team7.order.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 订单 Mapper 接口
 * </p>
 *
 * @author 张煜杰
 * @since 2021-10-20
 */
public interface OrderDao extends BaseMapper<Order> {
    //    多表联合分页查询
    Page<Order> getAllOrder(Page<Order> orderPage, @Param(Constants.WRAPPER) QueryWrapper<Order> wrapper);

    //    两表联查
    Order queryOrderAndPayLog(String id);
    //    通过课程id查询所有的订单信息
    List<Order> queryOrderByPay();
    //    通过课程id和会员id查询当前订单状态
    public Order getOrderStatusByCourseIdAndHuiYuanId(@Param("id") String id,@Param("HuiYuanId") String HuiYuanId);
}
